package com.bnlr.lrparking.appui.stall;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bnlr.lrparking.R;
import com.bnlr.lrparking.base.BaseActivity;

/**
 * Created by hp on 2017/10/10.
 * 个人和楼盘的选择
 */

public class SelectStallSourceActivity  extends BaseActivity{

    private TextView tvNavTitle;
    private RelativeLayout person_stall,developers_stall;
    private Intent intent;
    private String dealType;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_selectstallsource);
        initView();
    }

    private void initView(){
        Intent intent1=getIntent();
        dealType=intent1.getStringExtra("dealType");
        tvNavTitle = (TextView) findViewById(R.id.tv_nav_title);
        tvNavTitle.setText("选择车位来源");
        person_stall=(RelativeLayout)findViewById(R.id.person_stall);
        developers_stall=(RelativeLayout)findViewById(R.id.developers_stall);
        person_stall.setOnClickListener(this);
        developers_stall.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.person_stall://个人
                intent = new Intent(SelectStallSourceActivity.this, StallDealActivity.class);
                intent.putExtra("dealType", dealType);
                intent.putExtra("spaceowertype","0");
                intent.putExtra("developId","0");
                startActivity(intent);
                break;
            case R.id.developers_stall://开发商到开发商列表
                intent = new Intent(SelectStallSourceActivity.this, SelectDevelopersActivity.class);
                intent.putExtra("dealType", dealType);
                intent.putExtra("spaceowertype","1");
                startActivity(intent);
                break;
        }
    }
}
